// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 
// Source File Name:   SocketBasedHost.java

package org.quickserver.net.client;

import java.net.InetSocketAddress;
import java.net.UnknownHostException;

// Referenced classes of package org.quickserver.net.client:
//            Host

public class SocketBasedHost extends Host
{

    public SocketBasedHost()
    {
    }

    public SocketBasedHost(String host, int port)
        throws Exception
    {
        setInetSocketAddress(host, port);
    }

    public String toString()
    {
        StringBuilder sb = new StringBuilder();
        if(getName() != null)
            sb.append(getName());
        sb.append("[");
        sb.append("Host:");
        sb.append(getInetSocketAddress());
        sb.append("; Status:");
        sb.append(getStatus());
        sb.append("]");
        return sb.toString();
    }

    public InetSocketAddress getInetSocketAddress()
    {
        return inetSocketAddress;
    }

    public void setInetSocketAddress(String host, int port)
        throws UnknownHostException
    {
        setInetSocketAddress(InetSocketAddress.createUnresolved(host, port));
    }

    public void setInetSocketAddress(InetSocketAddress inetSocketAddress)
        throws UnknownHostException
    {
        this.inetSocketAddress = inetSocketAddress;
        setInetAddress(inetSocketAddress.getHostName());
    }

    public String getTextToExpect()
    {
        return textToExpect;
    }

    public void setTextToExpect(String textToExpect)
    {
        this.textToExpect = textToExpect;
    }

    public boolean isSecure()
    {
        return secure;
    }

    public void setSecure(boolean secure)
    {
        this.secure = secure;
    }

    public String getRequestText()
    {
        return requestText;
    }

    public void setRequestText(String requestText)
    {
        this.requestText = requestText;
    }

    public String getResponseTextToExpect()
    {
        return responseTextToExpect;
    }

    public void setResponseTextToExpect(String responseTextToExpect)
    {
        this.responseTextToExpect = responseTextToExpect;
    }

    private InetSocketAddress inetSocketAddress;
    private String textToExpect;
    private boolean secure;
    private String requestText;
    private String responseTextToExpect;
}
